Xinu stands for Xinu Is Not Unix -- although it shares concepts and even names with Unix, the internal design differs completely. Xinu is a small, elegant operating system that supports dynamic process creation, dynamic memory allocation, network communication, local and remote file systems, a shell, and device-independent I/O functions. The small size makes Xinu suitable for embedded environments.
Most operating systems are heavily built around x86. Most teaching courses immediately dive into bootloaders, paging and virtual memory systems, A20 lines, and whatnot. These are all a bit tedious parts to understand and even more to port.
Xinu OS focus is on:
- Dynamic processes
- Driver abstraction
- File systems
- Networking
Basically, all the fun parts! It will allow you to set up a elegent operating system for tweaking and experimenting.
The source code does not contain too many lines of code and is clearly written.
Depending on the architecture of your hardware you probably should download on of the
source files that closely resembles yours.
In case you are in a hurry, you might want to focus on the following files and
directories:
- system/*.S -- platform specific assembly files
- system/{platinit,initialize}.c -- intializing the system
- system/resched.c -- context switching
- system/evec.c -- interrupt setup / handler
- system/{clkinit, clkhandle}.c -- used to setup the scheduler
- device/* -- uart, spi, gpio, (other hardware specific peripherals
- include/* -- various header files for the above
- *.ld -- linker scripts to set correct locations
- config/* -- configuration files to set correct compiler, flags and addresses
Once you have ported these files + have written an UART device driver, you should have a basic working operating system that you can use for further exploration and experimenting!
Check out https://github.com/real-xinu/xinu-stm32 for my port
- https://xinu.cs.purdue.edu/#code
- D. Comer, Operating System Design - The Xinu Approach, Second Edition CRC Press, 2015. ISBN 9781498712439.